<?php

/**
 * Torneo filter form base class.
 *
 * @package    prode
 * @subpackage filter
 * @author     Your name here
 */
abstract class BaseTorneoFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'descripcion'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'porcentajeganancia'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'montoxapuesta'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'habilitado'          => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'ultimominutoapuesta' => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'descripcion'         => new sfValidatorPass(array('required' => false)),
      'porcentajeganancia'  => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'montoxapuesta'       => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'habilitado'          => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'ultimominutoapuesta' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('torneo_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Torneo';
  }

  public function getFields()
  {
    return array(
      'id'                  => 'Number',
      'descripcion'         => 'Text',
      'porcentajeganancia'  => 'Number',
      'montoxapuesta'       => 'Number',
      'habilitado'          => 'Boolean',
      'ultimominutoapuesta' => 'Number',
    );
  }
}
